-
Notifications
You must be signed in to change notification settings - Fork 267
feat: Add support for unix_timestamp function
#2936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2936 +/- ##
============================================
+ Coverage 56.12% 59.61% +3.48%
- Complexity 976 1381 +405
============================================
Files 119 167 +48
Lines 11743 15506 +3763
Branches 2251 2569 +318
============================================
+ Hits 6591 9244 +2653
- Misses 4012 4961 +949
- Partials 1140 1301 +161 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| EmptyExpr monotonically_increasing_id = 64; | ||
| FromJson from_json = 89; | ||
| UnixTimestamp unix_timestamp = 65; | ||
| FromJson from_json = 66; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it is bad form to renumber protobuf fields.
| .try_into() | ||
| .map_err(|_| internal_datafusion_err!("unix_timestamp expects exactly one argument"))?; | ||
|
|
||
| match args { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Input could be Timestamp with no timezone. Do you need to handle that differently?
|
|
||
| Ok(ColumnarValue::Array(Arc::new(result))) | ||
| } | ||
| _ => Err(DataFusionError::Execution(format!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe input to unix_timestamp could be a string (and an optional format)
https://spark.apache.org/docs/latest/api/sql/index.html#unix_timestamp
Which issue does this PR close?
Closes #.
Rationale for this change
What changes are included in this PR?
unix_timestampfor timestamp and date inputsHow are these changes tested?
Benchmarks
Performance is not great: